/*
 * @Author: jack-ZM
 * @Date: 2022-09-22 09:15:40
 * @LastEditors: jack-ZM
 * @LastEditTime: 2022-10-20 23:34:12
 * @FilePath: /vite-admin-template/src/utils/auth.ts
 * @Description: token存储放到localStorage
 *
 * Copyright (c) 2022 by zsm smzhang@fiberhome.com, All Rights Reserved.
 */
import { removeInfo } from './storage';
const TokenKey = 'dev-token';
const TokenPrefix = 'Bearer';

const getToken = () => {
    return localStorage.getItem(TokenKey);
};
const setToken = (token: string) => {
    return localStorage.setItem(TokenKey, token);
};
const clearToken = () => {
    removeInfo(TokenKey, 1);
};
const isLogin = () => {
    return !!getToken();
};
export { TokenPrefix, isLogin, getToken, setToken, clearToken };
